import axios from '@/plugins/axios';
const BASE_API = import.meta.env.VITE_APP_BASE_APIURL as string;

import { CommonStore } from '@/store';
import { ResponseVo } from '@/type';

export namespace loginService {
  export const login = async (data:{userName:string,password:string}): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.post('/user/login',data,{ baseURL: BASE_API });
    return res;
  };
  export const loginOut = async (data:{userId:number}): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.get('/user/logOut',{params:data,baseURL: BASE_API });
    return res;
  };
  export const loginRecords = async (data:{loginName:string,mobile:string,pageNum:number,pageSize:number}): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.get('/user/history',{params:data,baseURL: BASE_API });
    return res;
  };
}
